package demo;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;

public class ExceptionDemoMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ExceptionDemo demo = new ExceptionDemo();
		
		try {
			demo.doStuff(false);
			String s = null;
			s.trim();
			try{
				demo.doMyStuff();
			} catch (MyException ex){
				System.out.println("my exception handled");
			}
			System.out.println("hmm");
		} catch (Exception e) 
		{	System.out.println("finally "+System.currentTimeMillis());
			e.printStackTrace();} 
		finally {
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			System.out.println("finally is executed "+
					System.currentTimeMillis());
		}

	}

}
